#include <stdio.h>

int sum_card(char card)
{
	int sum;
	char tmp;
	if(card == 'J' || card == 'Q' || card == 'K' || card == '1')
	{
		sum = 10;
	}
	else if(card == 'A')
	{
		sum = 1;
	}
	else
	{
		sum = (card - 48);
	}
	return sum;
} 

int main()
{
	char c[4];
	char tmp;
	while(1)
	{
		int sum = 0;
		int sum_a = 0;
		for(int i=1;i<=3;i++)
		{
			scanf("%c",&c[i]);
			if(c[i] == ' ')
			{
				scanf("%c",&c[i]);
			}
			if(c[i] == '1')
			{
				scanf("%c",&tmp);
			}
			if(sum_card(c[i]) == 1)
			{
				sum_a += 1;
			}
			sum += sum_card(c[i]);
		}
		for(int i=0;i<sum_a;i++)
		{
			if(sum <= 11)
			{
				sum += 10;
			}
		}
		printf("The score is %i\n",sum);
		scanf("%c",&tmp);
	}
	
	
	return 0;
}
